/**
 * 
 */
package com.naiterui.ehp.bs.patient.enums;

/**
 * 家庭成员关系enum

 * @since 2.18
 */
public enum FamilyRelationEnum {

    RELATION_FATHER (0, "父亲"),
    RELATION_MOTHER (1, "母亲"),
    RELATION_BS (2, "兄弟姐妹"),
    RELATION_SON (3, "子女"),
    RELATION_HANS (4, "丈夫"),
    RELATION_WIFE (5, "妻子"),
    RELATION_ONESELF (6, "本人"),
    RELATION_OTHER (7, "其它家庭成员");
    private Integer value;
    private String name;

    FamilyRelationEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static FamilyRelationEnum val(Integer code) {
        if (code == null) {
            return null;
        }
        for (FamilyRelationEnum s : values()) {    // values()方法返回enum实例的数组
            if (code == s.getValue().intValue()) {
                return s;
            }
        }
        return null;
    }

}
